import * as apiService from '@/services/api';

/**
 * 获取会员审核列表
 * @param params
 * @returns {Promise<*>}
 *
 */
const getAuditList = params => apiService.post(api.AUDIT_LIST, params);
/**
 * 获取会员审核记录详情
 * @param params
 * @returns {Promise<*>}
 *
 */
const getAuditDetail = params => apiService.post(api.AUDIT_DETAIL, params);
/**
 * 提交审核内容
 * @param id
 * @param step  1/2 一审/二审
 * @param status 审核结果
 * @returns {Promise<*>}
 *
 */
const updateAudit = ({
  manageId, step, status, remark, menuId, menuIds,
}) => {
  if (step === 1) {
    return apiService.post(api.AUDIT_UPDATE, {
      manageId, remark, status, menuId, menuIds,
    });
  }
  if (step === 2) {
    return apiService.post(api.AUDIT_UPDATE_SECOND, {
      manageId, remark, status, menuId, menuIds,
    });
  }
};
/**
 * 获取申请人列表
 * @param params
 * @returns {Promise<*>}
 *
 */
const getAuditApplierList = params => apiService.post(api.AUDIT_APPLIER_LIST, params);
/**
 * 获取一审人列表
 * @returns {Promise<*>}
 *
 */
const getAuditManList = () => apiService.post(api.AUDIT_MAN_LIST);
/**
 * 获取二审人列表
 * @returns {Promise<*>}
 *
 */
const getAuditManSecondList = () => apiService.post(api.AUDIT_MAN_LIST_SECOND);
/**
 * 获取操作人列表
 * @returns {Promise<*>}
 *
 */
const getAuditOperator = ({ status }) => apiService.post(api.AUDIT_OPERATOR, { status });
/**
 * 上分设置记录获取操作人
 * @returns {Promise<*>}
 *
 */
const getOperatorList = ({ proxyId }) => apiService.post(api.AUDIT_OPTOPERATOR, { proxyId });
/**
 * 上分清算记录获取操作人
 * @returns {Promise<*>}
 *
 */
const getOperatorClearList = ({ proxyId }) => apiService.post(api.AUDIT_OPTOPERATOR_CLEAR, { proxyId });

export {
  getAuditList,
  getAuditDetail,
  getAuditApplierList,
  getAuditManList,
  getAuditManSecondList,
  updateAudit,
  getAuditOperator,
  getOperatorList,
  getOperatorClearList,
};
